<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
	xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui">

<h:head></h:head>
<body>
	<ui:composition template="../templates/mainTemplate.xhtml">
		<ui:define name="content">
			<h:form id="myForm">
				<p:messages id="mesaj" showDetail="true" autoUpdate="true" closable="true" />
				<p:panel header="#{messages['tableDefination.title']}">
					<h:panelGrid columns="2">
						<h:outputText value="#{messages['defineUserGroup.name']} : " />
						<p:inputText value="#{cTableForm.name}" />

						<h:outputText value="#{messages['foodDefination.since']} : " />
						<p:calendar value="#{cTableForm.since}" />

						<h:outputText value="#{messages['foodDefination.till']} : " />
						<p:calendar value="#{cTableForm.till}" />

						<h:outputText />
						<h:panelGroup>
							<p:commandButton value="#{messages['action.save']}" action="#{cTableAction.save()}" update="myForm" />
							<p:commandButton value="#{messages['action.cancel']}" />
						</h:panelGroup>
					</h:panelGrid>
				</p:panel>

				<p:panel header="#{messages['tableDefination.tableList']}">
					<p:dataTable value="#{cTableForm.tables}" var="user" paginator="true" rows="7">
						<p:column headerText="Id">
							<h:outputText value="#{user.id}" />
						</p:column>
						<p:column headerText="#{messages['defineUserGroup.name']}">
							<h:outputText value="#{user.name}" />
						</p:column>
						<p:column headerText="#{messages['variableDefination.operation']}">
							<p:commandLink action="#{cTableAction.delete(user)}" update=":myForm">
								<p:graphicImage value="/images/remove.png" />
							</p:commandLink>
						</p:column>
					</p:dataTable>
				</p:panel>
			</h:form>
		</ui:define>
	</ui:composition>
</body>
</html>
